#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <ctime>

using namespace std;

typedef long long ll;
ll a[3000];

const ll M = 1000000007;
inline ll binpow(ll num, ll pow){
	ll ans = 1;
	while (pow > 0){
		if (pow & 1) {
			ans *= num;
			ans %= M;
		}
		pow >>= 1;
		num *= num;
		num %= M;
	}
	return ans;
}
inline ll rev(ll x){
	return binpow(x, M - 2);
}

int main()
{
	ios_base::sync_with_stdio(false);
	int n, x;
	ll D;
	while (cin >> n >> D >> x && n != 0){
		fill(a, a + n + 1, 1);
		ll ans = 0;
		ll curcdi = D;
		for (int i = 1; i <= n; ++i){
			for (int j = n; j > 0; --j){
				a[j] = a[j - 1];
				int l = max(j - x + 1, i - 1);
				if (l >= j) a[j] = 0;
				else {
					if (l <= 0) continue;
					a[j] -= a[l - 1];
					a[j] += M;
					a[j] %= M;
				}
			}
			a[i - 1] = 0;
			ans += a[n] * curcdi % M;
			ans %= M;
			
			curcdi *= (D - i) % M;
			curcdi %= M;
			curcdi *= rev(i + 1);
			curcdi %= M;
			
        for (int j = 1; j <= n; ++j){
				a[j] += a[j - 1];
        a[j] %= M;
        }
		}
		cout << ans << endl;

	}
	return 0;
}